/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('retailadvqa-public', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ActivityInfoQueryRequest {
  accessId?: string(name='AccessId'),
  isIncludeMainActivity?: boolean(name='IsIncludeMainActivity'),
  isMainActivity?: boolean(name='IsMainActivity'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  privateKey?: string(name='PrivateKey'),
  workspaceId?: string(name='WorkspaceId'),
}

model ActivityInfoQueryResponseBody = {
  data?: {
    data?: [  map[string]any ](name='Data'),
    pageNum?: long(name='PageNum'),
    pageSize?: long(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ActivityInfoQueryResponse = {
  headers: map[string]string(name='headers'),
  body: ActivityInfoQueryResponseBody(name='body'),
}

async function activityInfoQueryWithOptions(request: ActivityInfoQueryRequest, runtime: Util.RuntimeOptions): ActivityInfoQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ActivityInfoQuery', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function activityInfoQuery(request: ActivityInfoQueryRequest): ActivityInfoQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return activityInfoQueryWithOptions(request, runtime);
}

model AddTemplateRequest {
  accessId?: string(name='AccessId', description='oem code'),
  comefrom?: string(name='Comefrom', description='模板来源'),
  isVariable?: long(name='IsVariable', description='是否为变量短信'),
  platformIds?: string(name='PlatformIds', description='平台ID，多个平台英文逗号分隔'),
  remark?: string(name='Remark', description='短信模板申请说明'),
  templateContent?: string(name='TemplateContent', description='模板内容'),
  templateName?: string(name='TemplateName', description='模板名称'),
  templateType?: long(name='TemplateType', description='模板类型'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model AddTemplateResponseBody = {
  data?: string(name='Data', description='模板ID，多个ID间英文逗号分隔'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  exStack?: string(name='ExStack', description='exStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model AddTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: AddTemplateResponseBody(name='body'),
}

async function addTemplateWithOptions(request: AddTemplateRequest, runtime: Util.RuntimeOptions): AddTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddTemplate', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addTemplate(request: AddTemplateRequest): AddTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return addTemplateWithOptions(request, runtime);
}

model AudienceDetailByIdRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  tenantId?: string(name='TenantId'),
}

model AudienceDetailByIdResponseBody = {
  data?: {
    id?: string(name='Id'),
    name?: string(name='Name'),
    numberOfAudiences?: long(name='NumberOfAudiences'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model AudienceDetailByIdResponse = {
  headers: map[string]string(name='headers'),
  body: AudienceDetailByIdResponseBody(name='body'),
}

async function audienceDetailByIdWithOptions(request: AudienceDetailByIdRequest, runtime: Util.RuntimeOptions): AudienceDetailByIdResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AudienceDetailById', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function audienceDetailById(request: AudienceDetailByIdRequest): AudienceDetailByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return audienceDetailByIdWithOptions(request, runtime);
}

model AudienceMemberQueryRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  delimiter?: string(name='Delimiter'),
  mappingTypes?: string(name='MappingTypes'),
  workspaceId?: string(name='WorkspaceId'),
}

model AudienceMemberQueryResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model AudienceMemberQueryResponse = {
  headers: map[string]string(name='headers'),
  body: AudienceMemberQueryResponseBody(name='body'),
}

async function audienceMemberQueryWithOptions(request: AudienceMemberQueryRequest, runtime: Util.RuntimeOptions): AudienceMemberQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AudienceMemberQuery', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function audienceMemberQuery(request: AudienceMemberQueryRequest): AudienceMemberQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return audienceMemberQueryWithOptions(request, runtime);
}

model AudiencePushStatusRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  workspaceId?: string(name='WorkspaceId'),
}

model AudiencePushStatusResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model AudiencePushStatusResponse = {
  headers: map[string]string(name='headers'),
  body: AudiencePushStatusResponseBody(name='body'),
}

async function audiencePushStatusWithOptions(request: AudiencePushStatusRequest, runtime: Util.RuntimeOptions): AudiencePushStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AudiencePushStatus', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function audiencePushStatus(request: AudiencePushStatusRequest): AudiencePushStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return audiencePushStatusWithOptions(request, runtime);
}

model CheckAudienceExportStatusRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  tenantId?: string(name='TenantId'),
}

model CheckAudienceExportStatusResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CheckAudienceExportStatusResponse = {
  headers: map[string]string(name='headers'),
  body: CheckAudienceExportStatusResponseBody(name='body'),
}

async function checkAudienceExportStatusWithOptions(request: CheckAudienceExportStatusRequest, runtime: Util.RuntimeOptions): CheckAudienceExportStatusResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('CheckAudienceExportStatus', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function checkAudienceExportStatus(request: CheckAudienceExportStatusRequest): CheckAudienceExportStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkAudienceExportStatusWithOptions(request, runtime);
}

model CheckMarketingAudienceExportStatusRequest {
  accessId?: string(name='AccessId', description='租户Id'),
  audienceId?: string(name='AudienceId', description='受众Id'),
  workspaceId?: string(name='WorkspaceId', description='空间Id'),
}

model CheckMarketingAudienceExportStatusResponseBody = {
  data?: {
    exportStatus?: string(name='ExportStatus'),
    ossFilePath?: string(name='OssFilePath'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CheckMarketingAudienceExportStatusResponse = {
  headers: map[string]string(name='headers'),
  body: CheckMarketingAudienceExportStatusResponseBody(name='body'),
}

async function checkMarketingAudienceExportStatusWithOptions(request: CheckMarketingAudienceExportStatusRequest, runtime: Util.RuntimeOptions): CheckMarketingAudienceExportStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckMarketingAudienceExportStatus', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkMarketingAudienceExportStatus(request: CheckMarketingAudienceExportStatusRequest): CheckMarketingAudienceExportStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkMarketingAudienceExportStatusWithOptions(request, runtime);
}

model CheckPermissionRequest {
  accessId?: string(name='AccessId', description='组织ID'),
  connStr?: string(name='ConnStr', description='数据库连接串'),
  dbSchema?: string(name='DbSchema', description='pgsql需要'),
  dsType?: string(name='DsType', description='数据源类型'),
  exportField?: string(name='ExportField', description='导出字段'),
  instance?: string(name='Instance', description='实例名'),
  userId?: string(name='UserId', description='用户ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model CheckPermissionResponseBody = {
  data?: [ 
    {
      fileldName?: string(name='FileldName', description='字段名'),
      rowPermissions?: [ string ](name='RowPermissions', description='字段权限'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model CheckPermissionResponse = {
  headers: map[string]string(name='headers'),
  body: CheckPermissionResponseBody(name='body'),
}

async function checkPermissionWithOptions(request: CheckPermissionRequest, runtime: Util.RuntimeOptions): CheckPermissionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckPermission', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkPermission(request: CheckPermissionRequest): CheckPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkPermissionWithOptions(request, runtime);
}

model CheckResourcepackSlrRequest {
  accessId?: string(name='AccessId'),
}

model CheckResourcepackSlrResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model CheckResourcepackSlrResponse = {
  headers: map[string]string(name='headers'),
  body: CheckResourcepackSlrResponseBody(name='body'),
}

async function checkResourcepackSlrWithOptions(request: CheckResourcepackSlrRequest, runtime: Util.RuntimeOptions): CheckResourcepackSlrResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckResourcepackSlr', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkResourcepackSlr(request: CheckResourcepackSlrRequest): CheckResourcepackSlrResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkResourcepackSlrWithOptions(request, runtime);
}

model CheckSmsReceiptExportStatusRequest {
  accessId?: string(name='AccessId', description='租户Id'),
  marketTaskId?: string(name='MarketTaskId', description='短信任务Id'),
  workspaceId?: string(name='WorkspaceId', description='空间Id'),
}

model CheckSmsReceiptExportStatusResponseBody = {
  data?: {
    exportStatus?: string(name='ExportStatus'),
    ossFilePath?: string(name='OssFilePath'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CheckSmsReceiptExportStatusResponse = {
  headers: map[string]string(name='headers'),
  body: CheckSmsReceiptExportStatusResponseBody(name='body'),
}

async function checkSmsReceiptExportStatusWithOptions(request: CheckSmsReceiptExportStatusRequest, runtime: Util.RuntimeOptions): CheckSmsReceiptExportStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckSmsReceiptExportStatus', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkSmsReceiptExportStatus(request: CheckSmsReceiptExportStatusRequest): CheckSmsReceiptExportStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkSmsReceiptExportStatusWithOptions(request, runtime);
}

model CheckUmengInnerOuterCompleteRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  message?: string(name='Message'),
  status?: long(name='Status'),
  taskId?: string(name='TaskId'),
  tenantId?: string(name='TenantId'),
}

model CheckUmengInnerOuterCompleteResponseBody = {
  data?: boolean(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CheckUmengInnerOuterCompleteResponse = {
  headers: map[string]string(name='headers'),
  body: CheckUmengInnerOuterCompleteResponseBody(name='body'),
}

async function checkUmengInnerOuterCompleteWithOptions(request: CheckUmengInnerOuterCompleteRequest, runtime: Util.RuntimeOptions): CheckUmengInnerOuterCompleteResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckUmengInnerOuterComplete', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkUmengInnerOuterComplete(request: CheckUmengInnerOuterCompleteRequest): CheckUmengInnerOuterCompleteResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkUmengInnerOuterCompleteWithOptions(request, runtime);
}

model ConsumeMediaResourcePackageRequest {
  consumeInfos?: string(name='ConsumeInfos'),
  consumeTime?: long(name='ConsumeTime'),
  consumeType?: string(name='ConsumeType'),
  productId?: string(name='ProductId'),
}

model ConsumeMediaResourcePackageResponseBody = {
  data?: {
    count?: int32(name='Count'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model ConsumeMediaResourcePackageResponse = {
  headers: map[string]string(name='headers'),
  body: ConsumeMediaResourcePackageResponseBody(name='body'),
}

async function consumeMediaResourcePackageWithOptions(request: ConsumeMediaResourcePackageRequest, runtime: Util.RuntimeOptions): ConsumeMediaResourcePackageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ConsumeMediaResourcePackage', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function consumeMediaResourcePackage(request: ConsumeMediaResourcePackageRequest): ConsumeMediaResourcePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return consumeMediaResourcePackageWithOptions(request, runtime);
}

model ConsumeResPacksRequest {
  accessId?: string(name='AccessId'),
  consumeInfos?: string(name='ConsumeInfos'),
  consumeTime?: long(name='ConsumeTime'),
  consumeType?: string(name='ConsumeType'),
  productId?: string(name='ProductId'),
  template?: string(name='Template'),
  tenantId?: string(name='TenantId'),
}

model ConsumeResPacksResponseBody = {
  data?: {
    count?: int32(name='Count'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ConsumeResPacksResponse = {
  headers: map[string]string(name='headers'),
  body: ConsumeResPacksResponseBody(name='body'),
}

async function consumeResPacksWithOptions(request: ConsumeResPacksRequest, runtime: Util.RuntimeOptions): ConsumeResPacksResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ConsumeResPacks', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function consumeResPacks(request: ConsumeResPacksRequest): ConsumeResPacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return consumeResPacksWithOptions(request, runtime);
}

model CreateDataSourceRequest {
  accessId?: string(name='AccessId'),
  createType?: string(name='CreateType'),
  dataSourceId?: string(name='DataSourceId'),
  dataSourceType?: string(name='DataSourceType'),
  databaseAddress?: string(name='DatabaseAddress'),
  databaseName?: string(name='DatabaseName'),
  databasePassword?: string(name='DatabasePassword'),
  databasePort?: string(name='DatabasePort'),
  databaseUserName?: string(name='DatabaseUserName'),
  displayName?: string(name='DisplayName'),
  regionCode?: string(name='RegionCode'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateDataSourceResponseBody = {
  data?: {
    dataSourceId?: string(name='DataSourceId'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  exStack?: string(name='ExStack'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  traceId?: string(name='TraceId'),
}

model CreateDataSourceResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDataSourceResponseBody(name='body'),
}

async function createDataSourceWithOptions(request: CreateDataSourceRequest, runtime: Util.RuntimeOptions): CreateDataSourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDataSource', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDataSource(request: CreateDataSourceRequest): CreateDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDataSourceWithOptions(request, runtime);
}

model CreateDatasetRequest {
  accessId?: string(name='AccessId'),
  dataSet?: map[string]any(name='DataSet'),
  dataSetName?: string(name='DataSetName'),
  tenantId?: string(name='TenantId'),
  type?: string(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateDatasetShrinkRequest {
  accessId?: string(name='AccessId'),
  dataSetShrink?: string(name='DataSet'),
  dataSetName?: string(name='DataSetName'),
  tenantId?: string(name='TenantId'),
  type?: string(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateDatasetResponseBody = {
  data?: {
    id?: string(name='Id'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CreateDatasetResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDatasetResponseBody(name='body'),
}

async function createDatasetWithOptions(tmpReq: CreateDatasetRequest, runtime: Util.RuntimeOptions): CreateDatasetResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDatasetShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataSet)) {
    request.dataSetShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataSet, 'DataSet', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDataset', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDataset(request: CreateDatasetRequest): CreateDatasetResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDatasetWithOptions(request, runtime);
}

model CreateDefaultEventRequest {
  accessId?: string(name='AccessId'),
  eventModelStr?: string(name='EventModelStr'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateDefaultEventResponseBody = {
  data?: {
    createId?: string(name='CreateId'),
    eventAttributeList?: [ 
      {
        eventAttributeCode?: string(name='EventAttributeCode'),
        eventAttributeName?: string(name='EventAttributeName'),
        eventAttributeTypeCode?: long(name='EventAttributeTypeCode'),
        eventId?: string(name='EventId'),
      }
    ](name='EventAttributeList'),
    eventCode?: string(name='EventCode'),
    eventId?: string(name='EventId'),
    eventName?: string(name='EventName'),
    eventSourceId?: string(name='EventSourceId'),
    eventSourceName?: string(name='EventSourceName'),
    eventType?: long(name='EventType'),
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    modifiedId?: string(name='ModifiedId'),
    orgnizationId?: string(name='OrgnizationId'),
    workspaceId?: string(name='WorkspaceId'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CreateDefaultEventResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDefaultEventResponseBody(name='body'),
}

async function createDefaultEventWithOptions(request: CreateDefaultEventRequest, runtime: Util.RuntimeOptions): CreateDefaultEventResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDefaultEvent', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDefaultEvent(request: CreateDefaultEventRequest): CreateDefaultEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDefaultEventWithOptions(request, runtime);
}

model CreateDefaultEventSourceRequest {
  accessId?: string(name='AccessId'),
  eventSourceModelStr?: string(name='EventSourceModelStr'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateDefaultEventSourceResponseBody = {
  data?: {
    createId?: string(name='CreateId'),
    errDescription?: string(name='ErrDescription'),
    eventSourceCode?: string(name='EventSourceCode'),
    eventSourceId?: string(name='EventSourceId'),
    eventSourceName?: string(name='EventSourceName'),
    eventSourceType?: string(name='EventSourceType'),
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    isUse?: int32(name='IsUse'),
    modifyId?: string(name='ModifyId'),
    orgnizationId?: string(name='OrgnizationId'),
    workspaceId?: string(name='WorkspaceId'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CreateDefaultEventSourceResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDefaultEventSourceResponseBody(name='body'),
}

async function createDefaultEventSourceWithOptions(request: CreateDefaultEventSourceRequest, runtime: Util.RuntimeOptions): CreateDefaultEventSourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDefaultEventSource', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDefaultEventSource(request: CreateDefaultEventSourceRequest): CreateDefaultEventSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDefaultEventSourceWithOptions(request, runtime);
}

model CreateExportTaskRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  tenantId?: string(name='TenantId'),
}

model CreateExportTaskResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model CreateExportTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateExportTaskResponseBody(name='body'),
}

async function createExportTaskWithOptions(request: CreateExportTaskRequest, runtime: Util.RuntimeOptions): CreateExportTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateExportTask', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createExportTask(request: CreateExportTaskRequest): CreateExportTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createExportTaskWithOptions(request, runtime);
}

model DeleteTemplatesRequest {
  accessId?: string(name='AccessId', description='oem code'),
  comefrom?: string(name='Comefrom', description='来源'),
  id?: string(name='Id', description='主键'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model DeleteTemplatesResponseBody = {
  data?: long(name='Data', description='删除条数'),
  errorCode?: string(name='ErrorCode', description='错误信息'),
  errorDesc?: string(name='ErrorDesc', description='错误信息描述'),
  exStack?: string(name='ExStack', description='exStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  traceId?: string(name='TraceId', description='traceId'),
}

model DeleteTemplatesResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteTemplatesResponseBody(name='body'),
}

async function deleteTemplatesWithOptions(request: DeleteTemplatesRequest, runtime: Util.RuntimeOptions): DeleteTemplatesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteTemplates', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteTemplates(request: DeleteTemplatesRequest): DeleteTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTemplatesWithOptions(request, runtime);
}

model DetailDigitalTemplateRequest {
  accessId?: string(name='AccessId', description='oem code'),
  id?: string(name='Id', description='主键'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model DetailDigitalTemplateResponseBody = {
  data?: {
    digitalSmsMaterialModels?: [ 
      {
        content?: string(name='Content', description='素材内容oss地址'),
        materialIndex?: long(name='MaterialIndex', description='素材顺序'),
        size?: long(name='Size', description='素材大小'),
        suffix?: string(name='Suffix', description='素材前缀'),
        type?: long(name='Type', description='素材类型'),
      }
    ](name='DigitalSmsMaterialModels', description='素材信息'),
    id?: string(name='Id', description='主键'),
    platformId?: string(name='PlatformId', description='平台ID'),
    platformName?: string(name='PlatformName', description='平台名称'),
    reason?: string(name='Reason', description='审核信息'),
    sign?: string(name='Sign', description='签名'),
    smsTemplateCode?: string(name='SmsTemplateCode', description='模板编号'),
    supportProvider?: string(name='SupportProvider', description='支持运营商'),
    templateName?: string(name='TemplateName', description='模板名称'),
    templateStatus?: long(name='TemplateStatus', description='模板状态'),
    templateTheme?: string(name='TemplateTheme', description='模板主题'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model DetailDigitalTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: DetailDigitalTemplateResponseBody(name='body'),
}

async function detailDigitalTemplateWithOptions(request: DetailDigitalTemplateRequest, runtime: Util.RuntimeOptions): DetailDigitalTemplateResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('DetailDigitalTemplate', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function detailDigitalTemplate(request: DetailDigitalTemplateRequest): DetailDigitalTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return detailDigitalTemplateWithOptions(request, runtime);
}

model DetailTemplateRequest {
  accessId?: string(name='AccessId', description='oem_access_id'),
  id?: string(name='Id', description='主键'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model DetailTemplateResponseBody = {
  data?: {
    id?: string(name='Id', description='主键'),
    isVariable?: long(name='IsVariable', description='是否为变量模板'),
    platformId?: string(name='PlatformId', description='平台ID'),
    reason?: string(name='Reason', description='模板申请信息'),
    remark?: string(name='Remark', description='模板申请说明'),
    smsContentSuffix?: string(name='SmsContentSuffix', description='模板内容后缀'),
    smsTemplateCode?: string(name='SmsTemplateCode', description='模板code'),
    templateContent?: string(name='TemplateContent', description='模板内容'),
    templateName?: string(name='TemplateName', description='模板名称'),
    templateStatus?: long(name='TemplateStatus', description='模板状态'),
    templateType?: long(name='TemplateType', description='模板类型'),
  }(name='Data', description='结果'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  exStack?: string(name='ExStack', description='exStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model DetailTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: DetailTemplateResponseBody(name='body'),
}

async function detailTemplateWithOptions(request: DetailTemplateRequest, runtime: Util.RuntimeOptions): DetailTemplateResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('DetailTemplate', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function detailTemplate(request: DetailTemplateRequest): DetailTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return detailTemplateWithOptions(request, runtime);
}

model ExportMarketingAudienceToOSSRequest {
  accessId?: string(name='AccessId', description='租户Id'),
  audienceId?: string(name='AudienceId', description='受众Id'),
  workspaceId?: string(name='WorkspaceId', description='空间Id'),
}

model ExportMarketingAudienceToOSSResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ExportMarketingAudienceToOSSResponse = {
  headers: map[string]string(name='headers'),
  body: ExportMarketingAudienceToOSSResponseBody(name='body'),
}

async function exportMarketingAudienceToOSSWithOptions(request: ExportMarketingAudienceToOSSRequest, runtime: Util.RuntimeOptions): ExportMarketingAudienceToOSSResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ExportMarketingAudienceToOSS', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function exportMarketingAudienceToOSS(request: ExportMarketingAudienceToOSSRequest): ExportMarketingAudienceToOSSResponse {
  var runtime = new Util.RuntimeOptions{};
  return exportMarketingAudienceToOSSWithOptions(request, runtime);
}

model ExportSmsReceiptToOSSRequest {
  accessId?: string(name='AccessId', description='租户Id'),
  marketTaskId?: string(name='MarketTaskId', description='短信任务Id'),
  workspaceId?: string(name='WorkspaceId', description='空间id'),
}

model ExportSmsReceiptToOSSResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ExportSmsReceiptToOSSResponse = {
  headers: map[string]string(name='headers'),
  body: ExportSmsReceiptToOSSResponseBody(name='body'),
}

async function exportSmsReceiptToOSSWithOptions(request: ExportSmsReceiptToOSSRequest, runtime: Util.RuntimeOptions): ExportSmsReceiptToOSSResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ExportSmsReceiptToOSS', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function exportSmsReceiptToOSS(request: ExportSmsReceiptToOSSRequest): ExportSmsReceiptToOSSResponse {
  var runtime = new Util.RuntimeOptions{};
  return exportSmsReceiptToOSSWithOptions(request, runtime);
}

model GetAudienceMarketingInfoRequest {
  accessId?: string(name='AccessId', description='租户id'),
  latestDataModifyEndTime?: string(name='LatestDataModifyEndTime', description='yyyy-MM-dd HH:mm:ss'),
  latestDataModifyStartTime?: string(name='LatestDataModifyStartTime', description='yyyy-MM-dd HH:mm:ss'),
  pageNum?: long(name='PageNum', description='页码'),
  pageSize?: long(name='PageSize', description='单页行数'),
  workspaceId?: string(name='WorkspaceId', description='空间Id'),
}

model GetAudienceMarketingInfoResponseBody = {
  data?: {
    content?: [ 
      {
        defaultMappingType?: string(name='DefaultMappingType'),
        errorMessage?: string(name='ErrorMessage'),
        gmtCreate?: string(name='GmtCreate'),
        gmtModified?: string(name='GmtModified'),
        id?: string(name='Id'),
        latestDataModifyStatus?: string(name='LatestDataModifyStatus'),
        latestDataModifyTime?: string(name='LatestDataModifyTime'),
        name?: string(name='Name'),
        numberOfAudiences?: long(name='NumberOfAudiences'),
        smsMarketingModel?: {
          hasMarketingJob?: boolean(name='HasMarketingJob'),
          hasMarketingTask?: boolean(name='HasMarketingTask'),
          marketingJobs?: [ 
            {
              jobId?: string(name='JobId'),
              jobName?: string(name='JobName'),
              status?: string(name='Status'),
            }
          ](name='MarketingJobs'),
          marketingMainAudienceId?: string(name='MarketingMainAudienceId'),
          marketingTasks?: [ 
            {
              createTime?: string(name='CreateTime'),
              jobId?: string(name='JobId'),
              marketType?: string(name='MarketType'),
              modifyTime?: string(name='ModifyTime'),
              status?: string(name='Status'),
              taskId?: string(name='TaskId'),
              taskName?: string(name='TaskName'),
            }
          ](name='MarketingTasks'),
        }(name='SmsMarketingModel'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum'),
    pageSize?: long(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model GetAudienceMarketingInfoResponse = {
  headers: map[string]string(name='headers'),
  body: GetAudienceMarketingInfoResponseBody(name='body'),
}

async function getAudienceMarketingInfoWithOptions(request: GetAudienceMarketingInfoRequest, runtime: Util.RuntimeOptions): GetAudienceMarketingInfoResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAudienceMarketingInfo', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAudienceMarketingInfo(request: GetAudienceMarketingInfoRequest): GetAudienceMarketingInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAudienceMarketingInfoWithOptions(request, runtime);
}

model GetInstanceInstanceRequest {
  accessId?: string(name='AccessId'),
  accountId?: string(name='AccountId'),
  accountName?: string(name='AccountName'),
}

model GetInstanceInstanceResponseBody = {
  data?: {
    retInstanceInfo?: string(name='RetInstanceInfo'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model GetInstanceInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: GetInstanceInstanceResponseBody(name='body'),
}

async function getInstanceInstanceWithOptions(request: GetInstanceInstanceRequest, runtime: Util.RuntimeOptions): GetInstanceInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstanceInstance', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstanceInstance(request: GetInstanceInstanceRequest): GetInstanceInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceInstanceWithOptions(request, runtime);
}

model GetInstanceInstanceInstanceRequest {
  accessId?: string(name='AccessId'),
  accountId?: string(name='AccountId'),
  accountName?: string(name='AccountName'),
}

model GetInstanceInstanceInstanceResponseBody = {
  data?: {
    retInstanceInfo?: string(name='RetInstanceInfo'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetInstanceInstanceInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: GetInstanceInstanceInstanceResponseBody(name='body'),
}

async function getInstanceInstanceInstanceWithOptions(request: GetInstanceInstanceInstanceRequest, runtime: Util.RuntimeOptions): GetInstanceInstanceInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstanceInstanceInstance', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstanceInstanceInstance(request: GetInstanceInstanceInstanceRequest): GetInstanceInstanceInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceInstanceInstanceWithOptions(request, runtime);
}

model GetMediaResourcePackageRequest {
  accessId?: string(name='AccessId'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resourceType?: string(name='ResourceType'),
  status?: string(name='Status'),
  template?: string(name='Template'),
}

model GetMediaResourcePackageResponseBody = {
  data?: {
    bagsInfo?: string(name='BagsInfo'),
    currentPage?: int32(name='CurrentPage'),
    effectiveInstanceFlag?: boolean(name='EffectiveInstanceFlag'),
    pageCount?: int32(name='PageCount'),
    pageSize?: int32(name='PageSize'),
    slrGrantedFlag?: boolean(name='SlrGrantedFlag'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetMediaResourcePackageResponse = {
  headers: map[string]string(name='headers'),
  body: GetMediaResourcePackageResponseBody(name='body'),
}

async function getMediaResourcePackageWithOptions(request: GetMediaResourcePackageRequest, runtime: Util.RuntimeOptions): GetMediaResourcePackageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetMediaResourcePackage', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getMediaResourcePackage(request: GetMediaResourcePackageRequest): GetMediaResourcePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMediaResourcePackageWithOptions(request, runtime);
}

model GetResPacksRequest {
  accessId?: string(name='AccessId'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  productId?: string(name='ProductId'),
  status?: string(name='Status'),
  template?: string(name='Template'),
  tenantId?: string(name='TenantId'),
}

model GetResPacksResponseBody = {
  data?: {
    bagsInfo?: string(name='BagsInfo'),
    currentPage?: int32(name='CurrentPage'),
    effectiveInstanceFlag?: boolean(name='EffectiveInstanceFlag'),
    pageCount?: int32(name='PageCount'),
    pageSize?: int32(name='PageSize'),
    slrGrantedFlag?: boolean(name='SlrGrantedFlag'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model GetResPacksResponse = {
  headers: map[string]string(name='headers'),
  body: GetResPacksResponseBody(name='body'),
}

async function getResPacksWithOptions(request: GetResPacksRequest, runtime: Util.RuntimeOptions): GetResPacksResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetResPacks', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getResPacks(request: GetResPacksRequest): GetResPacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return getResPacksWithOptions(request, runtime);
}

model GetTokenPayLoadByCheckRequest {
  accessId?: string(name='AccessId'),
  signDriver?: string(name='SignDriver'),
  signNonce?: string(name='SignNonce'),
  signPk?: string(name='SignPk'),
  signToken?: string(name='SignToken'),
  tenantId?: string(name='TenantId'),
}

model GetTokenPayLoadByCheckResponseBody = {
  data?: {
    aud?: string(name='Aud'),
    audName?: string(name='AudName'),
    dbRegion?: string(name='DbRegion'),
    language?: string(name='Language'),
    mainAccount?: string(name='MainAccount'),
    mainAccountUid?: string(name='MainAccountUid'),
    nickName?: string(name='NickName'),
    purchasePackage?: string(name='PurchasePackage'),
    purchasePackageQuota?: string(name='PurchasePackageQuota'),
    role?: string(name='Role'),
    roleSign?: string(name='RoleSign'),
    tenantRegion?: string(name='TenantRegion'),
    userId?: string(name='UserId'),
    workspaceId?: string(name='WorkspaceId'),
    workspaces?: [ 
      {
        id?: string(name='Id'),
        name?: string(name='Name'),
        roleId?: string(name='RoleId'),
      }
    ](name='Workspaces'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model GetTokenPayLoadByCheckResponse = {
  headers: map[string]string(name='headers'),
  body: GetTokenPayLoadByCheckResponseBody(name='body'),
}

async function getTokenPayLoadByCheckWithOptions(request: GetTokenPayLoadByCheckRequest, runtime: Util.RuntimeOptions): GetTokenPayLoadByCheckResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetTokenPayLoadByCheck', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getTokenPayLoadByCheck(request: GetTokenPayLoadByCheckRequest): GetTokenPayLoadByCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTokenPayLoadByCheckWithOptions(request, runtime);
}

model ListAccountRequest {
  accessId?: string(name='AccessId'),
  regionId?: string(name='RegionId'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListAccountResponseBody = {
  data?: [ 
    {
      aud?: string(name='Aud'),
      nickName?: string(name='NickName'),
      role?: string(name='Role'),
      userId?: string(name='UserId'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListAccountResponse = {
  headers: map[string]string(name='headers'),
  body: ListAccountResponseBody(name='body'),
}

async function listAccountWithOptions(request: ListAccountRequest, runtime: Util.RuntimeOptions): ListAccountResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListAccount', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listAccount(request: ListAccountRequest): ListAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccountWithOptions(request, runtime);
}

model ListAudienceRequest {
  accessId?: string(name='AccessId'),
  columnName?: string(name='ColumnName'),
  name?: string(name='Name'),
  order?: string(name='Order'),
  pageNum?: string(name='PageNum'),
  pageSize?: string(name='PageSize'),
  tenantId?: string(name='TenantId'),
  userId?: string(name='UserId'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListAudienceResponseBody = {
  data?: {
    content?: [ 
      {
        errorMessage?: string(name='ErrorMessage'),
        gmtCreate?: string(name='GmtCreate'),
        gmtModified?: string(name='GmtModified'),
        id?: string(name='Id'),
        isDynamic?: boolean(name='IsDynamic'),
        latestDataModifyStatus?: string(name='LatestDataModifyStatus'),
        latestDataModifyTime?: string(name='LatestDataModifyTime'),
        mappingTypes?: [ string ](name='MappingTypes'),
        name?: string(name='Name'),
        numberOfAudiences?: string(name='NumberOfAudiences'),
      }
    ](name='Content'),
    pageNum?: string(name='PageNum'),
    pageSize?: string(name='PageSize'),
    totalNum?: string(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListAudienceResponse = {
  headers: map[string]string(name='headers'),
  body: ListAudienceResponseBody(name='body'),
}

async function listAudienceWithOptions(request: ListAudienceRequest, runtime: Util.RuntimeOptions): ListAudienceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListAudience', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listAudience(request: ListAudienceRequest): ListAudienceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAudienceWithOptions(request, runtime);
}

model ListDatasetRequest {
  accessId?: string(name='AccessId'),
  tenantId?: string(name='TenantId'),
  type?: string(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListDatasetResponseBody = {
  data?: [ 
    {
      dataSetType?: int32(name='DataSetType'),
      extBehavior?: {
        behaviorAmountsField?: string(name='BehaviorAmountsField'),
        behaviorChannelField?: string(name='BehaviorChannelField'),
        behaviorCountsField?: string(name='BehaviorCountsField'),
        behaviorDateField?: string(name='BehaviorDateField'),
        behaviorObjectTypeField?: string(name='BehaviorObjectTypeField'),
        behaviorObjectValueField?: string(name='BehaviorObjectValueField'),
        behaviorTypeField?: string(name='BehaviorTypeField'),
        channelDimTableName?: string(name='ChannelDimTableName'),
        channelField?: string(name='ChannelField'),
        objectTypeContext?: map[string]any(name='ObjectTypeContext'),
        typeDimTableName?: string(name='TypeDimTableName'),
        typeField?: string(name='TypeField'),
      }(name='ExtBehavior'),
      extLabel?: {
        datasetLabelList?: [ 
          {
            colType?: string(name='ColType'),
            columnAlias?: string(name='ColumnAlias'),
            columnName?: string(name='ColumnName'),
            labelSeparator?: string(name='LabelSeparator'),
            remark?: string(name='Remark'),
            tableName?: string(name='TableName'),
          }
        ](name='DatasetLabelList'),
      }(name='ExtLabel'),
      extMappingTypes?: map[string]any(name='ExtMappingTypes'),
      extRFM?: {
        comparisonCalculateType?: int32(name='ComparisonCalculateType'),
        dataFromType?: string(name='DataFromType'),
        frequencyScoreCompareValue?: string(name='FrequencyScoreCompareValue'),
        frequencyScoreConfig?: [ 
          {
            end?: int32(name='End'),
            score?: int32(name='Score'),
            start?: int32(name='Start'),
          }
        ](name='FrequencyScoreConfig'),
        monetaryScoreCompareValue?: string(name='MonetaryScoreCompareValue'),
        monetaryScoreConfig?: [ 
          {
            end?: string(name='End'),
            score?: string(name='Score'),
            start?: string(name='Start'),
          }
        ](name='MonetaryScoreConfig'),
        period?: int32(name='Period'),
        recencyScoreCompareValue?: string(name='RecencyScoreCompareValue'),
        recencyScoreConfig?: [ 
          {
            end?: int32(name='End'),
            score?: int32(name='Score'),
            start?: int32(name='Start'),
          }
        ](name='RecencyScoreConfig'),
        tradeDateField?: string(name='TradeDateField'),
        tradeFrequencyField?: string(name='TradeFrequencyField'),
        tradeMoneyField?: string(name='TradeMoneyField'),
        tradeMoneyUnit?: int32(name='TradeMoneyUnit'),
      }(name='ExtRFM'),
      factTable?: string(name='FactTable'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModified?: string(name='GmtModified'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      uniqueFieldName?: string(name='UniqueFieldName'),
      uniqueMappingType?: string(name='UniqueMappingType'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListDatasetResponse = {
  headers: map[string]string(name='headers'),
  body: ListDatasetResponseBody(name='body'),
}

async function listDatasetWithOptions(request: ListDatasetRequest, runtime: Util.RuntimeOptions): ListDatasetResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListDataset', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listDataset(request: ListDatasetRequest): ListDatasetResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDatasetWithOptions(request, runtime);
}

model ListDigitalTemplatesRequest {
  accessId?: string(name='AccessId', description='oem code'),
  columnName?: string(name='ColumnName', description='排列字段名称'),
  keyword?: string(name='Keyword', description='模糊查询值'),
  order?: string(name='Order', description='排列顺序字段'),
  pageNum?: long(name='PageNum', description='页码'),
  pageSize?: long(name='PageSize', description='页大小'),
  smsSign?: string(name='SmsSign', description='短信签名'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='工作空间'),
}

model ListDigitalTemplatesResponseBody = {
  data?: {
    content?: [ 
      {
        id?: string(name='Id', description='主键'),
        platformId?: string(name='PlatformId', description='平台ID'),
        platformName?: string(name='PlatformName', description='平台名称'),
        reason?: string(name='Reason', description='审核信息'),
        sign?: string(name='Sign', description='签名'),
        smsTemplateCode?: string(name='SmsTemplateCode', description='模板编号'),
        supportProvider?: string(name='SupportProvider', description='支持运营商'),
        templateName?: string(name='TemplateName', description='模板名称'),
        templateStatus?: long(name='TemplateStatus', description='模板状态'),
        templateTheme?: string(name='TemplateTheme', description='模板主题'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', description='页码'),
    pageSize?: long(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总数量'),
  }(name='Data', description='结果数据'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息描述'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model ListDigitalTemplatesResponse = {
  headers: map[string]string(name='headers'),
  body: ListDigitalTemplatesResponseBody(name='body'),
}

async function listDigitalTemplatesWithOptions(request: ListDigitalTemplatesRequest, runtime: Util.RuntimeOptions): ListDigitalTemplatesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListDigitalTemplates', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listDigitalTemplates(request: ListDigitalTemplatesRequest): ListDigitalTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDigitalTemplatesWithOptions(request, runtime);
}

model ListMenuRequest {
  accessId?: string(name='AccessId'),
  roleSign?: string(name='RoleSign'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListMenuResponseBody = {
  data?: [ 
    {
      key?: string(name='Key'),
      name?: string(name='Name'),
      url?: string(name='Url'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListMenuResponse = {
  headers: map[string]string(name='headers'),
  body: ListMenuResponseBody(name='body'),
}

async function listMenuWithOptions(request: ListMenuRequest, runtime: Util.RuntimeOptions): ListMenuResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListMenu', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listMenu(request: ListMenuRequest): ListMenuResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMenuWithOptions(request, runtime);
}

model ListSignsRequest {
  accessId?: string(name='AccessId', description='oemcode'),
  pageNum?: long(name='PageNum', description='页码'),
  pageSize?: long(name='PageSize', description='页大小'),
  platformId?: string(name='PlatformId', description='平台ID'),
  signName?: string(name='SignName', description='签名名称'),
  signStatus?: string(name='SignStatus', description='签名状态'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model ListSignsResponseBody = {
  data?: {
    content?: [ 
      {
        createUserName?: string(name='CreateUserName', description='创建者'),
        errDescription?: string(name='ErrDescription', description='错误描述'),
        gmtCreate?: long(name='GmtCreate', description='创建时间'),
        id?: string(name='Id', description='主键'),
        platformName?: string(name='PlatformName', description='平台名称'),
        qaAccountId?: string(name='QaAccountId', description='qa账号'),
        signName?: string(name='SignName', description='签名名称'),
        signStatus?: long(name='SignStatus', description='签名状态'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum'),
    pageSize?: long(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息描述'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model ListSignsResponse = {
  headers: map[string]string(name='headers'),
  body: ListSignsResponseBody(name='body'),
}

async function listSignsWithOptions(request: ListSignsRequest, runtime: Util.RuntimeOptions): ListSignsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListSigns', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listSigns(request: ListSignsRequest): ListSignsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSignsWithOptions(request, runtime);
}

model ListTableRequest {
  accessId?: string(name='AccessId'),
  tenantId?: string(name='TenantId'),
}

model ListTableResponseBody = {
  data?: [ 
    {
      columns?: [ 
        {
          columnType?: string(name='ColumnType'),
          comment?: string(name='Comment'),
          name?: string(name='Name'),
        }
      ](name='Columns'),
      tableName?: string(name='TableName'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListTableResponse = {
  headers: map[string]string(name='headers'),
  body: ListTableResponseBody(name='body'),
}

async function listTableWithOptions(request: ListTableRequest, runtime: Util.RuntimeOptions): ListTableResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTable', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTable(request: ListTableRequest): ListTableResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTableWithOptions(request, runtime);
}

model ListTemplatesRequest {
  accessId?: string(name='AccessId', description='oemcode'),
  columnName?: string(name='ColumnName', description='排序字段名称'),
  comefrom?: string(name='Comefrom', description='模板来源'),
  isVariable?: long(name='IsVariable', description='是否为变量模板'),
  keyword?: string(name='Keyword', description='模糊查询值'),
  order?: string(name='Order', description='排序顺序字段'),
  pageNum?: long(name='PageNum', description='页码'),
  pageSize?: long(name='PageSize', description='页大小'),
  platformId?: string(name='PlatformId', description='平台id'),
  templateType?: long(name='TemplateType', description='模板类型'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model ListTemplatesResponseBody = {
  data?: {
    content?: [ 
      {
        id?: string(name='Id', description='主键'),
        platformName?: string(name='PlatformName', description='平台名称'),
        smsContentSuffix?: string(name='SmsContentSuffix', description='模板前缀'),
        smsTemplateCode?: string(name='SmsTemplateCode', description='模板code'),
        templateContent?: string(name='TemplateContent', description='模板内容'),
        templateName?: string(name='TemplateName', description='模板名称'),
        templateStatus?: long(name='TemplateStatus', description='模板状态'),
        templateType?: long(name='TemplateType', description='模板类型'),
        workspaceId?: string(name='WorkspaceId', description='平台ID'),
      }
    ](name='Content'),
    pageNum?: long(name='PageNum', description='页码'),
    pageSize?: long(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总条数'),
  }(name='Data', description='结果数据，具体看接口文档'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息描述'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  traceId?: string(name='TraceId', description='traceId'),
}

model ListTemplatesResponse = {
  headers: map[string]string(name='headers'),
  body: ListTemplatesResponseBody(name='body'),
}

async function listTemplatesWithOptions(request: ListTemplatesRequest, runtime: Util.RuntimeOptions): ListTemplatesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListTemplates', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listTemplates(request: ListTemplatesRequest): ListTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplatesWithOptions(request, runtime);
}

model ListWorkspaceRequest {
  accessId?: string(name='AccessId'),
  tenantId?: string(name='TenantId'),
}

model ListWorkspaceResponseBody = {
  data?: [ 
    {
      gmtCreate?: string(name='GmtCreate'),
      workspaceId?: string(name='WorkspaceId'),
      workspaceName?: string(name='WorkspaceName'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model ListWorkspaceResponse = {
  headers: map[string]string(name='headers'),
  body: ListWorkspaceResponseBody(name='body'),
}

async function listWorkspaceWithOptions(request: ListWorkspaceRequest, runtime: Util.RuntimeOptions): ListWorkspaceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListWorkspace', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listWorkspace(request: ListWorkspaceRequest): ListWorkspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWorkspaceWithOptions(request, runtime);
}

model LoadDataToExternalAudienceRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  ossPath?: string(name='OssPath'),
}

model LoadDataToExternalAudienceResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  exStack?: string(name='ExStack'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  traceId?: string(name='TraceId'),
}

model LoadDataToExternalAudienceResponse = {
  headers: map[string]string(name='headers'),
  body: LoadDataToExternalAudienceResponseBody(name='body'),
}

async function loadDataToExternalAudienceWithOptions(request: LoadDataToExternalAudienceRequest, runtime: Util.RuntimeOptions): LoadDataToExternalAudienceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('LoadDataToExternalAudience', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function loadDataToExternalAudience(request: LoadDataToExternalAudienceRequest): LoadDataToExternalAudienceResponse {
  var runtime = new Util.RuntimeOptions{};
  return loadDataToExternalAudienceWithOptions(request, runtime);
}

model LoadDataToLabelDataSetRequest {
  accessId?: string(name='AccessId'),
  colNameList?: [ string ](name='ColNameList'),
  cubeId?: string(name='CubeId'),
  ossPath?: string(name='OssPath'),
  separator?: string(name='Separator'),
}

model LoadDataToLabelDataSetResponseBody = {
  data?: boolean(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  exStack?: string(name='ExStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model LoadDataToLabelDataSetResponse = {
  headers: map[string]string(name='headers'),
  body: LoadDataToLabelDataSetResponseBody(name='body'),
}

async function loadDataToLabelDataSetWithOptions(request: LoadDataToLabelDataSetRequest, runtime: Util.RuntimeOptions): LoadDataToLabelDataSetResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('LoadDataToLabelDataSet', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function loadDataToLabelDataSet(request: LoadDataToLabelDataSetRequest): LoadDataToLabelDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return loadDataToLabelDataSetWithOptions(request, runtime);
}

model MarketTaskInfoQueryRequest {
  accessId?: string(name='AccessId'),
  marketType?: string(name='MarketType'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  privateKey?: string(name='PrivateKey'),
  workspaceId?: string(name='WorkspaceId'),
}

model MarketTaskInfoQueryResponseBody = {
  data?: {
    data?: [  map[string]any ](name='Data'),
    pageNum?: long(name='PageNum'),
    pageSize?: long(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model MarketTaskInfoQueryResponse = {
  headers: map[string]string(name='headers'),
  body: MarketTaskInfoQueryResponseBody(name='body'),
}

async function marketTaskInfoQueryWithOptions(request: MarketTaskInfoQueryRequest, runtime: Util.RuntimeOptions): MarketTaskInfoQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('MarketTaskInfoQuery', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function marketTaskInfoQuery(request: MarketTaskInfoQueryRequest): MarketTaskInfoQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return marketTaskInfoQueryWithOptions(request, runtime);
}

model NewListMenuRequest {
  accessId?: string(name='AccessId'),
  roleSign?: string(name='RoleSign'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model NewListMenuResponseBody = {
  data?: [ 
    {
      children?: map[string]any(name='Children'),
      key?: string(name='Key'),
      name?: string(name='Name'),
      order?: string(name='Order'),
      parentKey?: string(name='ParentKey'),
      sourceType?: string(name='SourceType'),
      url?: string(name='Url'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model NewListMenuResponse = {
  headers: map[string]string(name='headers'),
  body: NewListMenuResponseBody(name='body'),
}

async function newListMenuWithOptions(request: NewListMenuRequest, runtime: Util.RuntimeOptions): NewListMenuResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('NewListMenu', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function newListMenu(request: NewListMenuRequest): NewListMenuResponse {
  var runtime = new Util.RuntimeOptions{};
  return newListMenuWithOptions(request, runtime);
}

model OemListMenuRequest {
  accessId?: string(name='AccessId'),
  regionId?: string(name='RegionId'),
  roleSign?: string(name='RoleSign'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId'),
}

model OemListMenuResponseBody = {
  data?: [ 
    {
      children?: [  map[string]any ](name='Children'),
      key?: string(name='Key'),
      name?: string(name='Name'),
      order?: string(name='Order'),
      parentKey?: string(name='ParentKey'),
      permission?: boolean(name='Permission'),
      purchasePackage?: boolean(name='PurchasePackage'),
      sourceType?: string(name='SourceType'),
      url?: string(name='Url'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model OemListMenuResponse = {
  headers: map[string]string(name='headers'),
  body: OemListMenuResponseBody(name='body'),
}

async function oemListMenuWithOptions(request: OemListMenuRequest, runtime: Util.RuntimeOptions): OemListMenuResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('OemListMenu', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function oemListMenu(request: OemListMenuRequest): OemListMenuResponse {
  var runtime = new Util.RuntimeOptions{};
  return oemListMenuWithOptions(request, runtime);
}

model ParamListRequest {
  accessId?: string(name='AccessId'),
  paramType?: long(name='ParamType', description='配置类型'),
  platformType?: long(name='PlatformType', description='平台类型'),
  tenantId?: string(name='TenantId'),
  workspaceId?: string(name='WorkspaceId', description='工作空间ID'),
}

model ParamListResponseBody = {
  data?: [ 
    {
      platformId?: string(name='PlatformId', description='平台ID'),
      platformName?: string(name='PlatformName', description='平台名称'),
      platformType?: long(name='PlatformType', description='平台类型'),
    }
  ](name='Data', description='结果数据'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  exStack?: string(name='ExStack', description='exStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model ParamListResponse = {
  headers: map[string]string(name='headers'),
  body: ParamListResponseBody(name='body'),
}

async function paramListWithOptions(request: ParamListRequest, runtime: Util.RuntimeOptions): ParamListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ParamList', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function paramList(request: ParamListRequest): ParamListResponse {
  var runtime = new Util.RuntimeOptions{};
  return paramListWithOptions(request, runtime);
}

model QueryFunctionModuleRequest {
  accessId?: string(name='AccessId', description='oem_access_id'),
  tenantId?: string(name='TenantId', description='组织ID'),
}

model QueryFunctionModuleResponseBody = {
  data?: {
    expiredDate?: string(name='ExpiredDate', description='过期时间'),
    functionModuleList?: [ 
      {
        moduleCode?: string(name='ModuleCode'),
        moduleName?: string(name='ModuleName'),
      }
    ](name='FunctionModuleList', description='功能包列表'),
    organizationId?: string(name='OrganizationId', description='组织ID'),
  }(name='Data', description='结果'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  exStack?: string(name='ExStack', description='exStack'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model QueryFunctionModuleResponse = {
  headers: map[string]string(name='headers'),
  body: QueryFunctionModuleResponseBody(name='body'),
}

async function queryFunctionModuleWithOptions(request: QueryFunctionModuleRequest, runtime: Util.RuntimeOptions): QueryFunctionModuleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryFunctionModule', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryFunctionModule(request: QueryFunctionModuleRequest): QueryFunctionModuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFunctionModuleWithOptions(request, runtime);
}

model QueryMediaResourcePackageRequest {
  accessId?: string(name='AccessId'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  resourceType?: string(name='ResourceType'),
  status?: string(name='Status'),
  template?: string(name='Template'),
}

model QueryMediaResourcePackageResponseBody = {
  data?: {
    bagsInfo?: string(name='BagsInfo'),
    currentPage?: int32(name='CurrentPage'),
    effectiveInstanceFlag?: boolean(name='EffectiveInstanceFlag'),
    pageCount?: int32(name='PageCount'),
    pageSize?: int32(name='PageSize'),
    slrGrantedFlag?: boolean(name='SlrGrantedFlag'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model QueryMediaResourcePackageResponse = {
  headers: map[string]string(name='headers'),
  body: QueryMediaResourcePackageResponseBody(name='body'),
}

async function queryMediaResourcePackageWithOptions(request: QueryMediaResourcePackageRequest, runtime: Util.RuntimeOptions): QueryMediaResourcePackageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryMediaResourcePackage', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryMediaResourcePackage(request: QueryMediaResourcePackageRequest): QueryMediaResourcePackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMediaResourcePackageWithOptions(request, runtime);
}

model RecieveEventMessageRequest {
  accessId?: string(name='AccessId'),
  eventMessageModelListStr?: string(name='EventMessageModelListStr'),
  organizationId?: string(name='OrganizationId'),
}

model RecieveEventMessageResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model RecieveEventMessageResponse = {
  headers: map[string]string(name='headers'),
  body: RecieveEventMessageResponseBody(name='body'),
}

async function recieveEventMessageWithOptions(request: RecieveEventMessageRequest, runtime: Util.RuntimeOptions): RecieveEventMessageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RecieveEventMessage', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function recieveEventMessage(request: RecieveEventMessageRequest): RecieveEventMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return recieveEventMessageWithOptions(request, runtime);
}

model RecieveUserMessageRequest {
  accessId?: string(name='AccessId'),
  customerMessageModelListStr?: string(name='CustomerMessageModelListStr'),
  organizationId?: string(name='OrganizationId'),
}

model RecieveUserMessageResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model RecieveUserMessageResponse = {
  headers: map[string]string(name='headers'),
  body: RecieveUserMessageResponseBody(name='body'),
}

async function recieveUserMessageWithOptions(request: RecieveUserMessageRequest, runtime: Util.RuntimeOptions): RecieveUserMessageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RecieveUserMessage', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function recieveUserMessage(request: RecieveUserMessageRequest): RecieveUserMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return recieveUserMessageWithOptions(request, runtime);
}

model RecreateTableRequest {
  accessId?: string(name='AccessId'),
  ossPath?: string(name='OssPath'),
  tableName?: string(name='TableName'),
  tableSchema?: map[string]any(name='TableSchema'),
  tenantId?: string(name='TenantId'),
}

model RecreateTableShrinkRequest {
  accessId?: string(name='AccessId'),
  ossPath?: string(name='OssPath'),
  tableName?: string(name='TableName'),
  tableSchemaShrink?: string(name='TableSchema'),
  tenantId?: string(name='TenantId'),
}

model RecreateTableResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model RecreateTableResponse = {
  headers: map[string]string(name='headers'),
  body: RecreateTableResponseBody(name='body'),
}

async function recreateTableWithOptions(tmpReq: RecreateTableRequest, runtime: Util.RuntimeOptions): RecreateTableResponse {
  Util.validateModel(tmpReq);
  var request = new RecreateTableShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tableSchema)) {
    request.tableSchemaShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tableSchema, 'TableSchema', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RecreateTable', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function recreateTable(request: RecreateTableRequest): RecreateTableResponse {
  var runtime = new Util.RuntimeOptions{};
  return recreateTableWithOptions(request, runtime);
}

model SaveExternalAudienceRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  audienceName?: string(name='AudienceName'),
  dataSourceId?: string(name='DataSourceId'),
  mappingType?: string(name='MappingType'),
  parentId?: string(name='ParentId'),
  workspaceId?: string(name='WorkspaceId'),
}

model SaveExternalAudienceResponseBody = {
  data?: {
    audienceId?: string(name='AudienceId'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SaveExternalAudienceResponse = {
  headers: map[string]string(name='headers'),
  body: SaveExternalAudienceResponseBody(name='body'),
}

async function saveExternalAudienceWithOptions(request: SaveExternalAudienceRequest, runtime: Util.RuntimeOptions): SaveExternalAudienceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SaveExternalAudience', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function saveExternalAudience(request: SaveExternalAudienceRequest): SaveExternalAudienceResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveExternalAudienceWithOptions(request, runtime);
}

model SaveExternalDirectoryRequest {
  accessId?: string(name='AccessId'),
  directoryId?: string(name='DirectoryId'),
  directoryName?: string(name='DirectoryName'),
  parentDirectoryId?: string(name='ParentDirectoryId'),
  type?: int32(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model SaveExternalDirectoryResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SaveExternalDirectoryResponse = {
  headers: map[string]string(name='headers'),
  body: SaveExternalDirectoryResponseBody(name='body'),
}

async function saveExternalDirectoryWithOptions(request: SaveExternalDirectoryRequest, runtime: Util.RuntimeOptions): SaveExternalDirectoryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SaveExternalDirectory', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function saveExternalDirectory(request: SaveExternalDirectoryRequest): SaveExternalDirectoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveExternalDirectoryWithOptions(request, runtime);
}

model SaveLabelDataSetRequest {
  accessId?: string(name='AccessId'),
  cubeId?: string(name='CubeId'),
  cubeName?: string(name='CubeName'),
  datasetLabelList?: [ 
    {
      columnComment?: string(name='ColumnComment'),
      columnName?: string(name='ColumnName'),
      columnType?: string(name='ColumnType'),
      mappingType?: string(name='MappingType'),
      remark?: string(name='Remark'),
      uniqueIdentification?: string(name='UniqueIdentification'),
    }
  ](name='DatasetLabelList'),
  dsId?: string(name='DsId'),
  tableName?: string(name='TableName'),
  workspaceId?: string(name='WorkspaceId'),
}

model SaveLabelDataSetResponseBody = {
  data?: {
    cubeId?: string(name='CubeId'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  traceId?: string(name='TraceId'),
}

model SaveLabelDataSetResponse = {
  headers: map[string]string(name='headers'),
  body: SaveLabelDataSetResponseBody(name='body'),
}

async function saveLabelDataSetWithOptions(request: SaveLabelDataSetRequest, runtime: Util.RuntimeOptions): SaveLabelDataSetResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SaveLabelDataSet', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function saveLabelDataSet(request: SaveLabelDataSetRequest): SaveLabelDataSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveLabelDataSetWithOptions(request, runtime);
}

model SearchAudienceRequest {
  accessId?: string(name='AccessId'),
  audienceId?: string(name='AudienceId'),
  workspaceId?: string(name='WorkspaceId'),
}

model SearchAudienceResponseBody = {
  data?: {
    autoUpdateData?: boolean(name='AutoUpdateData'),
    createUser?: string(name='CreateUser'),
    dataModelName?: string(name='DataModelName'),
    dbName?: string(name='DbName'),
    dbType?: string(name='DbType'),
    desc?: string(name='Desc'),
    errorMessage?: string(name='ErrorMessage'),
    extendMappingTypes?: [ 
      {
        columnName?: string(name='ColumnName'),
        defaultIdType?: string(name='DefaultIdType'),
        mappingType?: string(name='MappingType'),
        pathId?: string(name='PathId'),
      }
    ](name='ExtendMappingTypes'),
    gmtCreate?: long(name='GmtCreate'),
    gmtModified?: long(name='GmtModified'),
    id?: string(name='Id'),
    latestDataModifyStatus?: int32(name='LatestDataModifyStatus'),
    latestDataModifyTime?: long(name='LatestDataModifyTime'),
    modifyUser?: string(name='ModifyUser'),
    modifyUserName?: string(name='ModifyUserName'),
    name?: string(name='Name'),
    numberOfAudiences?: long(name='NumberOfAudiences'),
    parentId?: string(name='ParentId'),
    permission?: string(name='Permission'),
    public?: boolean(name='Public'),
    subtype?: int32(name='Subtype'),
    type?: int32(name='Type'),
    version?: string(name='Version'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SearchAudienceResponse = {
  headers: map[string]string(name='headers'),
  body: SearchAudienceResponseBody(name='body'),
}

async function searchAudienceWithOptions(request: SearchAudienceRequest, runtime: Util.RuntimeOptions): SearchAudienceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SearchAudience', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function searchAudience(request: SearchAudienceRequest): SearchAudienceResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchAudienceWithOptions(request, runtime);
}

model SearchAudiencesRequest {
  accessId?: string(name='AccessId'),
  name?: string(name='Name'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  parentId?: string(name='ParentId'),
  workspaceId?: string(name='WorkspaceId'),
}

model SearchAudiencesResponseBody = {
  data?: {
    content?: [ 
      {
        autoUpdateData?: boolean(name='AutoUpdateData'),
        createUser?: string(name='CreateUser'),
        dataModelName?: string(name='DataModelName'),
        dbName?: string(name='DbName'),
        dbType?: string(name='DbType'),
        desc?: string(name='Desc'),
        errorMessage?: string(name='ErrorMessage'),
        gmtCreate?: long(name='GmtCreate'),
        gmtModified?: long(name='GmtModified'),
        id?: string(name='Id'),
        latestDataModifyStatus?: int32(name='LatestDataModifyStatus'),
        latestDataModifyTime?: long(name='LatestDataModifyTime'),
        modifyUser?: string(name='ModifyUser'),
        modifyUserName?: string(name='ModifyUserName'),
        name?: string(name='Name'),
        numberOfAudiences?: long(name='NumberOfAudiences'),
        parentId?: string(name='ParentId'),
        permission?: string(name='Permission'),
        public?: boolean(name='Public'),
        subtype?: int32(name='Subtype'),
        type?: int32(name='Type'),
        version?: string(name='Version'),
      }
    ](name='Content'),
    pageNum?: int32(name='PageNum'),
    pageSize?: int32(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SearchAudiencesResponse = {
  headers: map[string]string(name='headers'),
  body: SearchAudiencesResponseBody(name='body'),
}

async function searchAudiencesWithOptions(request: SearchAudiencesRequest, runtime: Util.RuntimeOptions): SearchAudiencesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SearchAudiences', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function searchAudiences(request: SearchAudiencesRequest): SearchAudiencesResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchAudiencesWithOptions(request, runtime);
}

model SearchDirectoriesRequest {
  accessId?: string(name='AccessId'),
  directoryName?: string(name='DirectoryName'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  parentDirectoryId?: string(name='ParentDirectoryId'),
  type?: int32(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model SearchDirectoriesResponseBody = {
  data?: {
    content?: [ 
      {
        aiplSubType?: string(name='AiplSubType'),
        createUserName?: string(name='CreateUserName'),
        dbName?: string(name='DbName'),
        dbType?: string(name='DbType'),
        defaultCube?: string(name='DefaultCube'),
        desc?: string(name='Desc'),
        dsId?: string(name='DsId'),
        errorMessage?: string(name='ErrorMessage'),
        factTable?: string(name='FactTable'),
        fuseCube?: boolean(name='FuseCube'),
        gmtCreate?: long(name='GmtCreate'),
        gmtModified?: long(name='GmtModified'),
        id?: string(name='Id'),
        isMark?: int32(name='IsMark'),
        modifyUser?: string(name='ModifyUser'),
        modifyUserName?: string(name='ModifyUserName'),
        name?: string(name='Name'),
        parentId?: string(name='ParentId'),
        permission?: string(name='Permission'),
        subtype?: string(name='Subtype'),
        type?: int32(name='Type'),
        typeSource?: int32(name='TypeSource'),
        version?: string(name='Version'),
        workspaceId?: string(name='WorkspaceId'),
      }
    ](name='Content'),
    pageNum?: string(name='PageNum'),
    pageSize?: string(name='PageSize'),
    totalNum?: string(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SearchDirectoriesResponse = {
  headers: map[string]string(name='headers'),
  body: SearchDirectoriesResponseBody(name='body'),
}

async function searchDirectoriesWithOptions(request: SearchDirectoriesRequest, runtime: Util.RuntimeOptions): SearchDirectoriesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SearchDirectories', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function searchDirectories(request: SearchDirectoriesRequest): SearchDirectoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchDirectoriesWithOptions(request, runtime);
}

model SendDigitalSmsRequest {
  accessId?: string(name='AccessId', description='OEM code'),
  channelType?: long(name='ChannelType', description='任务类型'),
  outId?: string(name='OutId', description='外部流水拓展字段'),
  phoneNumbers?: string(name='PhoneNumbers', description='发送手机号'),
  platformId?: string(name='PlatformId', description='平台ID'),
  smsTemplateId?: string(name='SmsTemplateId', description='短信模板ID'),
  taskName?: string(name='TaskName', description='短信任务名称'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model SendDigitalSmsResponseBody = {
  data?: string(name='Data', description='发送结果'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口调用状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model SendDigitalSmsResponse = {
  headers: map[string]string(name='headers'),
  body: SendDigitalSmsResponseBody(name='body'),
}

async function sendDigitalSmsWithOptions(request: SendDigitalSmsRequest, runtime: Util.RuntimeOptions): SendDigitalSmsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('SendDigitalSms', '2020-05-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function sendDigitalSms(request: SendDigitalSmsRequest): SendDigitalSmsResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendDigitalSmsWithOptions(request, runtime);
}

model SendSmsRequest {
  accessId?: string(name='AccessId', description='oem code'),
  channelType?: long(name='ChannelType', description='发送渠道'),
  isVariable?: long(name='IsVariable', description='是否为变量短信'),
  outId?: string(name='OutId', description='外部流水拓展字段'),
  phoneNumbers?: string(name='PhoneNumbers', description='发送手机号'),
  platformId?: string(name='PlatformId', description='平台ID'),
  signName?: string(name='SignName', description='签名名称'),
  smsTemplateId?: string(name='SmsTemplateId', description='短信模板ID'),
  taskName?: string(name='TaskName', description='短信任务名称'),
  templateParam?: string(name='TemplateParam', description='短信模板变量对应的实际值'),
  tenantId?: string(name='TenantId', description='组织ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model SendSmsResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息描述'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success', description='接口是否调用成功'),
  traceId?: string(name='TraceId', description='traceId'),
}

model SendSmsResponse = {
  headers: map[string]string(name='headers'),
  body: SendSmsResponseBody(name='body'),
}

async function sendSmsWithOptions(request: SendSmsRequest, runtime: Util.RuntimeOptions): SendSmsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SendSms', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function sendSms(request: SendSmsRequest): SendSmsResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendSmsWithOptions(request, runtime);
}

model SmsShortUrlTaskQueryRequest {
  accessId?: string(name='AccessId'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
  privateKey?: string(name='PrivateKey'),
  workspaceId?: string(name='WorkspaceId'),
}

model SmsShortUrlTaskQueryResponseBody = {
  data?: {
    data?: [  map[string]any ](name='Data'),
    pageNum?: long(name='PageNum'),
    pageSize?: long(name='PageSize'),
    totalNum?: long(name='TotalNum'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model SmsShortUrlTaskQueryResponse = {
  headers: map[string]string(name='headers'),
  body: SmsShortUrlTaskQueryResponseBody(name='body'),
}

async function smsShortUrlTaskQueryWithOptions(request: SmsShortUrlTaskQueryRequest, runtime: Util.RuntimeOptions): SmsShortUrlTaskQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SmsShortUrlTaskQuery', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function smsShortUrlTaskQuery(request: SmsShortUrlTaskQueryRequest): SmsShortUrlTaskQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return smsShortUrlTaskQueryWithOptions(request, runtime);
}

model UpdateDatasetRequest {
  accessId?: string(name='AccessId'),
  dataSet?: string(name='DataSet'),
  dataSetId?: string(name='DataSetId'),
  dataSetName?: string(name='DataSetName'),
  tenantId?: string(name='TenantId'),
  type?: string(name='Type'),
  workspaceId?: string(name='WorkspaceId'),
}

model UpdateDatasetResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model UpdateDatasetResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateDatasetResponseBody(name='body'),
}

async function updateDatasetWithOptions(request: UpdateDatasetRequest, runtime: Util.RuntimeOptions): UpdateDatasetResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateDataset', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateDataset(request: UpdateDatasetRequest): UpdateDatasetResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDatasetWithOptions(request, runtime);
}

model UpdateTemplateRequest {
  accessId?: string(name='AccessId', description='oem code'),
  comefrom?: string(name='Comefrom', description='模板来源'),
  id?: string(name='Id', description='主键'),
  isVariable?: long(name='IsVariable', description='是否为变量短信'),
  platformIds?: string(name='PlatformIds', description='平台类型，用逗号分隔'),
  remark?: string(name='Remark', description='短信模板申请说明'),
  templateContent?: string(name='TemplateContent', description='模板内容'),
  templateName?: string(name='TemplateName', description='模板名称'),
  templateType?: long(name='TemplateType', description='短信类型'),
  tenantId?: string(name='TenantId', description='组织id'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model UpdateTemplateResponseBody = {
  data?: string(name='Data', description='修改记录条数'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误信息'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId', description='traceId'),
}

model UpdateTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateTemplateResponseBody(name='body'),
}

async function updateTemplateWithOptions(request: UpdateTemplateRequest, runtime: Util.RuntimeOptions): UpdateTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateTemplate', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateTemplate(request: UpdateTemplateRequest): UpdateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTemplateWithOptions(request, runtime);
}

model UserConfigQueryRequest {
  accessId?: string(name='AccessId'),
  tenantId?: string(name='TenantId'),
  userId?: string(name='UserId'),
}

model UserConfigQueryResponseBody = {
  data?: {
    language?: string(name='Language'),
    theme?: long(name='Theme'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorDesc?: string(name='ErrorDesc'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceId?: string(name='TraceId'),
}

model UserConfigQueryResponse = {
  headers: map[string]string(name='headers'),
  body: UserConfigQueryResponseBody(name='body'),
}

async function userConfigQueryWithOptions(request: UserConfigQueryRequest, runtime: Util.RuntimeOptions): UserConfigQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UserConfigQuery', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function userConfigQuery(request: UserConfigQueryRequest): UserConfigQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return userConfigQueryWithOptions(request, runtime);
}

model WorkSaveAudienceRequest {
  accessId?: string(name='AccessId', description='组织ID'),
  audienceName?: string(name='AudienceName', description='受众名称'),
  connStr?: string(name='ConnStr', description='数据库链接串'),
  dbSchema?: string(name='DbSchema', description='pgsql需要'),
  dsType?: string(name='DsType', description='数据源类型'),
  encryType?: string(name='EncryType', description='加密方式'),
  exportField?: string(name='ExportField', description='导出字段'),
  instance?: string(name='Instance', description='实例名'),
  mappingType?: string(name='MappingType', description='ID类型'),
  statement?: string(name='Statement', description='sql语句'),
  userId?: string(name='UserId', description='用户ID'),
  workspaceId?: string(name='WorkspaceId', description='空间ID'),
}

model WorkSaveAudienceResponseBody = {
  data?: string(name='Data', description='返回数据'),
  errorCode?: string(name='ErrorCode', description='错误码'),
  errorDesc?: string(name='ErrorDesc', description='错误描述'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口状态'),
  traceId?: string(name='TraceId', description='traceId'),
}

model WorkSaveAudienceResponse = {
  headers: map[string]string(name='headers'),
  body: WorkSaveAudienceResponseBody(name='body'),
}

async function workSaveAudienceWithOptions(request: WorkSaveAudienceRequest, runtime: Util.RuntimeOptions): WorkSaveAudienceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('WorkSaveAudience', '2020-05-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function workSaveAudience(request: WorkSaveAudienceRequest): WorkSaveAudienceResponse {
  var runtime = new Util.RuntimeOptions{};
  return workSaveAudienceWithOptions(request, runtime);
}

